<?php

declare(strict_types=1);
/**
 * Created by PhpStorm.
 * User: yangfan
 * Date: 2019/11/23
 * Time: 2:35 PM
 */

namespace App\Services\api;

use App\Entity\ProductEntity;

interface IProductService
{
    /**
     * @return ProductEntity/null
     */
    public function findOne(int $productId);

    /**
     * 当前产品是否在此城市销售
     *
     * @return bool
     */
    public function cityIsOpen(int $productId, int $cityId);

    /**
     * @param int $productId
     * @return \App\Entities\ProductEntity|null
     */
    public function getProductEntityById(int $productId);

    /**
     * @param int $categoryId
     * @param bool $onSale
     * @return ProductEntity[]
     */
    public function getProductsByCategoryId(int $categoryId, bool $onSale = true): array;

    /**
     * @param bool $onSale
     * @return ProductEntity[]
     */
    public function getAllProducts(bool $onSale = true): array;
}
